<include file="Public/min-header"/>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/index-debug.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/index.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/jquery.step.css">
<script src="__PUBLIC__/js/jquery-step/jquery.step.js"></script>
<div class="wrapper">
  <include file="Public/breadcrumb"/>
    <section class="content" style = "display:none;">
        <!-- Main content -->
        <div class="container-fluid">
            <div class="pull-right">                           		
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title" style="text-align:center;">一键在线发布小程序</h3>
                </div>
                <div class="panel-body">
                    <!--表单数据-->
                <form method="post" id="cleanCache">                    
                        <!--通用信息-->
                    <div class="tab-content">                 	  
                        <div class="tab-pane active" id="tab_tongyong">
                            <table class="table table-bordered">
                                <tbody>
                                <tr>
                                    <td style="text-align:center;">
										<a id="checkLogin" href="{:U('Admin/Update/upload_scan')}" class="btn btn-primary">获取登录二维码</a>
                                    </td>
                                </tr>
                                </tbody>                                
                            </table>
                        </div>                           
                    </div>              
			    </form><!--表单数据-->
                </div>
            </div>
        </div>    <!-- /.content -->
    </section>

<div class="content">
	<div class="contop">
		<div class="con1">请查看教程完成一、二、三步设置再点击扫描二维码登录<a href="https://www.kancloud.cn/tianxin100/duodianpu/660111">查看教程</a></div>
	</div>
	<div class="contop">
		<div class="con1">设置跳转小程序<a href="{:U('Admin/Update/add_jump')}">点击设置</a></div>
	</div>
	<div class="step-body" id="myStep">
		<div class="step-header">
			<ul>
				<li><p>扫描二维码登录</p></li>
				<li><p>预览小程序</p></li>
				<li><p>上传成功</p></li>
				<div class="clearfix"></div>
			</ul>
		</div>
		<div class="step-content">
			<div class="step-list">
				<div class="footer-btn">
					<div class="common-btn">
						<button id="applyBtn">获取登录二维码</button>
					</div>
					<div class="common-btn">
						<div class="erweim">
							<img id="login_pic" src="">
							<p>请使用小程序管理员或开发者微信扫码登录</p>
							<span id = "tongzhi" style="color:red;" >扫码后大约会有10秒针的延迟，请耐心等待</span>
							<span>扫码后大约会有10秒针的延迟，请耐心等待</span>
							<button id="nextstep">下一步</button>
						</div>
					</div>
				</div>
			</div>
			<div class="step-list">
				<div class="footer-btn">
					<div class="common-btn">
						<div class="erweim">
							<img id="preview_pic" src="">
							<p>请使用小程序管理员或开发者微信扫码预览</p>
							<span id = "tongzhi_preview" style="color:red;" >扫码后大约会有10秒针的延迟，请耐心等待</span>
							<button id = "laststep">上传小程序</button>
						</div>
					</div>
				</div>

			</div>
			<div class="step-list">
				<div class="apply-finish">
					<div class="apply-finish-header">
						<img src="__PUBLIC__/images/upload/success.png">
						<div class="apply-finish-msg">恭喜您，上传成功！</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
</div> 
<script>
	var step= $("#myStep").step({
		animate:true,
		initStep:1,
		speed:1000
	});
	$(function() {
		$(".erweim").hide();
		$("#applyBtn").click(function(event) {
			$(this).attr('disabled',"true").addClass("disabled").text("数据请求中···");
			$.post('{:U('Admin/Update/upload_scan')}',function($data){
			
				if($data.code==1){
					$("#login_pic").attr("src",$data.img);
					$("#tongzhi").text($data.tongzhi);
					$(".erweim").show();
					$("#applyBtn").hide();
				}else{
					$("#tongzhi").text($data.tongzhi);
					$(".erweim").find("img").hide();
					$(".erweim").find("p").hide();
					$(".erweim").find("button").hide();
					$(".erweim").show();
					$("#applyBtn").hide();
				}
			});

		});
		
		$("#preBtn").click(function(event) {
			var yes=step.preStep();
		});
		$("#nextstep").click(function(event) {
			$(this).attr('disabled',"true").addClass("disabled").text("数据请求中···");
			$.post('{:U('Admin/Update/upload_preview')}',function($data){
				var yes=step.nextStep();
				$("#preview_pic").attr("src",$data.img);
				$("#tongzhi_preview").text($data.tongzhi);
			});
		});
		$("#goBtn").click(function(event) {
			var yes=step.goStep(3);

		});
		$("#laststep").click(function(event) {
			$(this).attr('disabled',"true").addClass("disabled").text("数据请求中···");
			$.post('{:U('Admin/Update/upload_last')}',function($data){
				var yes=step.nextStep();
			});
		});
		
	});
	function filechange() { 
	  if(document.getElementById("submitBtn").value!=""){
		  var yes=step.nextStep();
	  }
	}
</script>  
</body>
</html>